package db

import "organoid_public/infrastructure/tool"

type BaseRepo struct {
	Where      map[string]any
	UpdateData map[string]interface{}
}

func NewBaseRepo() *BaseRepo {
	return &BaseRepo{Where: map[string]any{}, UpdateData: map[string]any{}}
}

func (b *BaseRepo) AddWhere(key string, val any) {
	b.Where[key] = val
}

func (b *BaseRepo) AddUpdate(data interface{}) {
	b.UpdateData = tool.StructToMap(data)
}
